<?php
/**
 * Nweb Framework
 *
 * This script is protected by copyright. It's use, copying, modification
 * and distribution without written consent of the author is prohibited.
 *
 * @category    source
 * @package     pl.nweb.framework.application.controller
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @license     http://www.gnu.org/licenses/lgpl-3.0.txt  GNU Lesser General Public
 * @version     3.0 $Id$
 * @link        http://code.google.com/p/nweb-framework/
 * @link        http://framework.nweb.pl
 */

namespace pl\nweb\framework\application\controller;

/**
 * Kontroler aplikacji żądania soap
 *
 * @category    source
 * @package     pl.nweb.framework.application.controller
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @version     3.0 $Id$
 */
class Soap extends \pl\nweb\framework\application\Controller
{
    /**
     * Wykonuje żądanie
     *
     * @param \pl\nweb\framework\Request\Soap obiekt żądania http
     * @param \pl\nweb\framework\Response\Soap obiekt odpowiedzi http
     * @return void
     * @throws \pl\nweb\framework\application\dispatcher\Exception
     */
    public function dispatch (\pl\nweb\framework\Request\Soap $request, \pl\nweb\framework\Response\Soap $response)
    {
        $response->clear();
        $results = parent::dispatch($request, $response);
        if($request->isDispatched() && !$response->hasContents()) {
            $response->setContents($results);
        }
    }
}